<div class="buttons atbottom">
	<ul>
		<li><a href="javascript:void(0)" class="cancel"><?php __("Xóa")?></a></li>
		<li><a href="javascript:void(0)" class="back unpublish"><?php __("Hủy kích hoạt")?></a></li>
		<li><a href="javascript:void(0)" class="submit publish"><?php __("Kích hoạt")?></a></li>
		<li><a href="<?php echo $html->url(array('plugin' => 'features', 'controller' => 'manage_features', 'action' => 'add') + $params)?>" class="new"><?php __("Thêm mới")?></a></li>
	</ul>
</div>

<!-- table -->
<div class="table">
	<table cellpadding="0" cellspacing="0" id='news_list'>
		<thead>
			<tr>
				<th width='20'><a><?php echo __("#"); ?></a></th>
				<th width='20'><input type="checkbox" id='checkbox-control' control='index'/></th>
				<th><?php echo $paginator->sort(__("Tên", true), "Feature.title"); ?></th>
				<th width='60'><?php echo $paginator->sort(__("Kích hoạt", true), 'Feature.is_published'); ?></th>
				<th width='110'><a><?php echo __("Chức năng"); ?></a></th>
			</tr>
		</thead>
		<tbody>
			<?php if(!$pages):?>
			<tr class="row1">
				<td colspan="5" align="center" style="font-weight:bold"><?php echo __("Chưa có dữ liệu.");?></td>
			</tr>
			<?php
			endif;
				$max = $paginator->params['paging']['Feature']['defaults']['limit'];
				$page = $paginator->params['paging']['Feature']['page'];
				$start = ($page - 1) * $max;
				$i=0;
				$class = 'altrow';
				foreach ($pages as $page):
					$class = $class == "" ? "class='odd'" : "";
					$page_id = $page['Feature']['id'];
					$i++;
			?>
			<tr <?php echo $class?> page_id="<?php echo $page_id?>">
				<td class="center"><?php echo ($start + $i)?></td>
				<td class="center"><input type="checkbox" class='index' name='checkbox_index[]' value='<?php echo $page_id?>'/></td>
				<td>
                    <div style="float: left; height: <?php echo ($config['height']); ?>px; overflow: hidden; max-width: 500px;">
                        <span class='field_name'><?php echo $page['Feature']['title']?></span><br/>
					    <span class='alias'><?php echo $page['Feature']['alias']?></span>
                    </div>
                    <div style="float: right; height: <?php echo ($config['height']); ?>px; width: <?php echo ($config['width']+10); ?>px; overflow: hidden;">
                        <!--img align='right' src='< ?php echo $html->url('/files/features/' . $html->getThumbnailName($page['Feature']['image'])); ?>'/-->
                       <?php echo $html->image('/files/features/' . $page['Feature']['image'], array('height' => $config['height']."px", 'align'=>'right') ); ?>
					</div>
				</td>
				
				<td align='center'>
					<?php echo ($page['Feature']['is_published']) ? $html->image('icons/arrow-7.gif', array('alt' => '')) : $html->image('icons/arrow-8.gif', array('alt' => ''))?>
				</td>
				
				<td class='actions'>
					<div class="functions">
						<div class="header"><h4><?php __("Chức năng");?></h4></div>
						<ul>
							<li><a href="<?php echo $html->url($params + array('controller'=>$this->params['controller'], 'action'=>'edit', $page_id))?>" class="edit"><?php __("Chỉnh sửa")?></a></li>
							<li><a href="<?php echo $html->url($params + array('controller'=>$this->params['controller'], 'action'=>'delete', $page_id))?>" class="delete delete_page" onclick="return confirm('<?php __("Bạn có thật sự muốn xóa công năng này?")?>')"><?php __("Xóa")?></a></li>
						</ul>
					</div>
				</td>
			</tr>
			<?php endforeach;?>
		</tbody>
	</table>
</div>
<!-- table.end -->

<!-- paging -->
<div class="paging-wrapper">
<?php echo $this->element('pagination/pagination', array('model' => 'Feature'));?>
</div>
<!-- paging.end -->

<div class="buttons atbottom">
	<ul>
		<li><a href="javascript:void(0)" class="cancel"><?php __("Xóa")?></a></li>
		<li><a href="javascript:void(0)" class="back unpublish"><?php __("Hủy kích hoạt")?></a></li>
		<li><a href="javascript:void(0)" class="submit publish"><?php __("Kích hoạt")?></a></li>
		<li><a href="<?php echo $html->url(array('plugin' => 'features', 'controller' => 'manage_features', 'action' => 'add') + $params)?>" class="new"><?php __("Thêm mới")?></a></li>
	</ul>
</div>